<?php


class EmsFormTable extends Doctrine_Table
{

    public function getEnabledFieldsByFormId($form_id)
    {
        $q = Doctrine_Query::create()
            ->from('EmsFormField ff')
            ->andWhere('ff.form_id = ?',$form_id)
            ->andWhere('ff.is_enabled = 1');

        return $q->execute();
    }


    public static function getInstance()
    {
        return Doctrine_Core::getTable('EmsForm');
    }
}